

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="https://image.lxandzjy.top/2022/06/06/8871b9e332dbe.png">
  <link rel="icon" href="https://image.lxandzjy.top/2022/06/06/8871b9e332dbe.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="zjy">
  <meta name="keywords" content="学习笔记,vue,axios,,JavaScript,前端,后端">
  
    <meta name="description" content="安装Centos7, VMware安装CentOS7超详细版 安装系统的时候 简单点可以直接选择默认的自动分区 网络那里一定要配置,好多小伙伴总是连不上网，安装时连接上，后面都没问题   Centos7 下配置DNS服务器centos7上安装DNS服务器可以实现域名与IP的双向解析，即通过域名可以找到主机IP，也可以通过IP找到域名。经历了多次失败,多次重装系统,简直不要太苦涩，对于重装系统的操作">
<meta property="og:type" content="article">
<meta property="og:title" content="VMware安装Centos7,Centos7下配置DNS服务器,配置WEB服务器,配置FTP服务器">
<meta property="og:url" content="https://zjy365.github.io/2021/06/23/VMware/index.html">
<meta property="og:site_name" content="土猪的个人博客">
<meta property="og:description" content="安装Centos7, VMware安装CentOS7超详细版 安装系统的时候 简单点可以直接选择默认的自动分区 网络那里一定要配置,好多小伙伴总是连不上网，安装时连接上，后面都没问题   Centos7 下配置DNS服务器centos7上安装DNS服务器可以实现域名与IP的双向解析，即通过域名可以找到主机IP，也可以通过IP找到域名。经历了多次失败,多次重装系统,简直不要太苦涩，对于重装系统的操作">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20210515101507936.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JlaWNoZW55dW1v,size_16,color_FFFFFF,t_70">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20210515103557564.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JlaWNoZW55dW1v,size_16,color_FFFFFF,t_70">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20210515102618841.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JlaWNoZW55dW1v,size_16,color_FFFFFF,t_70">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20210515104831208.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JlaWNoZW55dW1v,size_16,color_FFFFFF,t_70">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20210515105335176.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JlaWNoZW55dW1v,size_16,color_FFFFFF,t_70">
<meta property="article:published_time" content="2021-06-23T10:40:25.000Z">
<meta property="article:modified_time" content="2021-11-19T02:00:23.409Z">
<meta property="article:author" content="zjy">
<meta property="article:tag" content="Linux">
<meta property="article:tag" content="Centos7">
<meta property="article:tag" content="VMware">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/20210515101507936.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JlaWNoZW55dW1v,size_16,color_FFFFFF,t_70">
  
  
  
  <title>VMware安装Centos7,Centos7下配置DNS服务器,配置WEB服务器,配置FTP服务器 - 土猪的个人博客</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"zjy365.github.io","root":"/","version":"1.9.1","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>

  
<meta name="generator" content="Hexo 5.4.2"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>土猪</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('https://image.lxandzjy.top/2022/06/06/aea923ea1a0e8.jpg') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="VMware安装Centos7,Centos7下配置DNS服务器,配置WEB服务器,配置FTP服务器"></span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2021-06-23 18:40" pubdate>
          2021年6月23日 晚上
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          3.1k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          27 分钟
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">VMware安装Centos7,Centos7下配置DNS服务器,配置WEB服务器,配置FTP服务器</h1>
            
            <div class="markdown-body">
              
              <h2 id="安装Centos7-VMware安装CentOS7超详细版"><a href="#安装Centos7-VMware安装CentOS7超详细版" class="headerlink" title="安装Centos7, VMware安装CentOS7超详细版"></a>安装Centos7, <a target="_blank" rel="noopener" href="https://blog.csdn.net/tsundere_x/article/details/104263100">VMware安装CentOS7超详细版</a></h2><ul>
<li>安装系统的时候 简单点可以直接选择默认的自动分区</li>
<li>网络那里一定要配置,好多小伙伴总是连不上网，安装时连接上，后面都没问题</li>
</ul>
<hr>
<h2 id="Centos7-下配置DNS服务器"><a href="#Centos7-下配置DNS服务器" class="headerlink" title="Centos7 下配置DNS服务器"></a>Centos7 下配置DNS服务器</h2><p>centos7上安装DNS服务器可以实现域名与IP的双向解析，即通过域名可以找到主机IP，也可以通过IP找到域名。经历了多次失败,多次重装系统,简直不要太苦涩，对于重装系统的操作熟练的让人伤心。</p>
<ul>
<li><p>查看本机ip  <code>ip addr</code>  一般在ens33 ip长得类似这样 <code>192.168.202.129</code></p>
</li>
<li><p>安装bind  <code>yum install bind bind-utils -y</code></p>
</li>
<li><p>安装完成，可以查看named服务。  <code>systemctl status named</code></p>
</li>
<li><p>开始修改配置文件 <code>vim /etc/named.conf</code><img src="https://img-blog.csdnimg.cn/20210515101507936.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JlaWNoZW55dW1v,size_16,color_FFFFFF,t_70" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
</li>
<li><p>配置/etc/named.rfc1912.zones，增加一个正向解析与一个反向解析的配置，可以拷贝其他的zone 配置 ，下面的test.com也就是域名 改成自己想要的就可以了test.com 是例子</p>
 <figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell">cp -p named.localhost test.com.zone<br>cp -p named.loopback test.com.local<br></code></pre></td></tr></table></figure></li>
<li><p>有了两个文件，我们需要做修改，这里非常重要，因为文件格式在拷贝过程中可能会发生变化。<code>192.168.202.129</code>  129指的是ip最后的三位。下图是    <code>.zone   是域名的正向解析</code><br><img src="https://img-blog.csdnimg.cn/20210515103557564.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JlaWNoZW55dW1v,size_16,color_FFFFFF,t_70" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>下图是    <code>.local   是域名的反向解析</code><br><img src="https://img-blog.csdnimg.cn/20210515102618841.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JlaWNoZW55dW1v,size_16,color_FFFFFF,t_70" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
</li>
<li><p>配置本机DNS1，修改<code>/etc/sysconfig/network-scripts/ifcfg-en0或者/etc/sysconfig/network-scripts/ifcfg-ens33，</code><br>增加<code>DNS1=192.168.202.129</code></p>
</li>
<li><p>重启网络，启动named服务。named:<code>systemctl start named</code><br>网络：<code>service network restart</code></p>
</li>
<li><p>修改配置文件：<code>vim /etc/resolv.conf</code></p>
</li>
<li><p>进行验证 <code>nslookup www.域名    /      nslookup 192.168.202.129</code> </p>
<h6 id="大功告成-呼"><a href="#大功告成-呼" class="headerlink" title="大功告成  呼~~~"></a>大功告成  呼~~~</h6></li>
</ul>
<hr>
<h2 id="Centos7下配置WEB服务器"><a href="#Centos7下配置WEB服务器" class="headerlink" title="Centos7下配置WEB服务器"></a>Centos7下配置WEB服务器</h2><p> Web服务器一般指网站服务器，是指驻留于因特网上某种类型计算机的程序，可以处理浏览器等Web客户端的请求并返回相应响应，也可以放置网站文件，让全世界浏览；可以放置数据文件，让全世界下载。目前最主流的三个Web服务器是Apache、 Nginx 、IIS</p>
<ul>
<li><p>安装Apache服务  <code>yum install -y httpd</code></p>
</li>
<li><p>启动Apache服务  <code>ystemctl start httpd.service </code></p>
</li>
<li><p>切换目录 <code>cd /var/www</code></p>
</li>
<li><p>新建目录 <code>mkdir web</code></p>
</li>
<li><p>新建index.html    <code>echo &quot;this is web&quot; &gt; web/index.html</code></p>
</li>
<li><p> 修改配置文件 <code>在/etc/httpd/conf/httpd.conf</code><img src="https://img-blog.csdnimg.cn/20210515104831208.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JlaWNoZW55dW1v,size_16,color_FFFFFF,t_70" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
</li>
<li><p> 打开自己 浏览器进行测试<img src="https://img-blog.csdnimg.cn/20210515105335176.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JlaWNoZW55dW1v,size_16,color_FFFFFF,t_70" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h6 id="大功告成-呼-1"><a href="#大功告成-呼-1" class="headerlink" title="大功告成 呼~~~"></a>大功告成 呼~~~</h6></li>
</ul>
<hr>
<h2 id="Centos7下配置FTP服务器"><a href="#Centos7下配置FTP服务器" class="headerlink" title="Centos7下配置FTP服务器"></a>Centos7下配置FTP服务器</h2><p>FTP服务器（File Transfer Protocol Server）是在互联网上提供文件存储和访问服务的计算机，它们依照FTP协议提供服务。 FTP是File Transfer Protocol(文件传输协议)。顾名思义，就是专门用来传输文件的协议。简单地说，支持FTP协议的服务器就是FTP服务器</p>
<ul>
<li>安装vsftpd  <code>yum -y install vsftpd</code></li>
<li>按照下面修改配置文件  <code>vim vsftpd.conf</code></li>
</ul>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br></pre></td><td class="code"><pre><code class="hljs routeros"><span class="hljs-comment">#是否允许匿名，默认no</span><br><span class="hljs-attribute">anonymous_enable</span>=<span class="hljs-literal">NO</span><br><br><span class="hljs-comment">#这个设定值必须要为YES 时，在/etc/passwd内的账号才能以实体用户的方式登入我们的vsftpd主机</span><br><span class="hljs-attribute">local_enable</span>=<span class="hljs-literal">YES</span><br><br><span class="hljs-comment">#具有写权限</span><br><span class="hljs-attribute">write_enable</span>=<span class="hljs-literal">YES</span><br><br><span class="hljs-comment">#本地用户创建文件或目录的掩码</span><br><span class="hljs-attribute">local_umask</span>=022<br><br><span class="hljs-comment">#当dirmessage_enable=YES时，可以设定这个项目来让vsftpd寻找该档案来显示讯息！您也可以设定其它档名！</span><br><span class="hljs-attribute">dirmessage_enable</span>=<span class="hljs-literal">YES</span><br><br><span class="hljs-comment">#当设定为YES时，使用者上传与下载日志都会被纪录起来。记录日志与下一个xferlog_file设定选项有关：</span><br><span class="hljs-attribute">xferlog_enable</span>=<span class="hljs-literal">YES</span><br><span class="hljs-attribute">xferlog_std_format</span>=<span class="hljs-literal">YES</span><br><br><span class="hljs-comment">#上传与下载日志存放路径</span><br><span class="hljs-attribute">xferlog_file</span>=/var/log/xferlog<br><br><span class="hljs-comment">#开启20端口</span><br><span class="hljs-attribute">connect_from_port_20</span>=<span class="hljs-literal">YES</span><br><br><span class="hljs-comment">#关于系统安全的设定值：</span><br><span class="hljs-attribute">ascii_download_enable</span>=<span class="hljs-literal">YES</span>(NO)<br>如果设定为<span class="hljs-literal">YES</span> ，那么<span class="hljs-built_in"> client </span>就可以使用 ASCII 格式下载档案。<br>一般来说，由于启动了这个设定项目可能会导致DoS 的攻击，因此预设是<span class="hljs-literal">NO</span>。<br><span class="hljs-attribute">ascii_upload_enable</span>=<span class="hljs-literal">YES</span>(NO)<br>与上一个设定类似的，只是这个设定针对上传而言！预设是<span class="hljs-literal">NO</span>。<br><span class="hljs-attribute">ascii_upload_enable</span>=<span class="hljs-literal">NO</span><br><span class="hljs-attribute">ascii_download_enable</span>=<span class="hljs-literal">NO</span><br><br><span class="hljs-comment">#通过搭配能实现以下几种效果：</span><br>①当<span class="hljs-attribute">chroot_list_enable</span>=<span class="hljs-literal">YES</span>，chroot_local_user=YES时，在/etc/vsftpd.chroot_list文件中列出的用户，可以切换到其他目录；未在文件中列出的用户，不能切换到其他目录。<br>②当<span class="hljs-attribute">chroot_list_enable</span>=<span class="hljs-literal">YES</span>，chroot_local_user=NO时，<br>在/etc/vsftpd.chroot_list文件中列出的用户，不能切换到其他目录；未在文件中列出的用户，可以切换到其他目录。<br>③当<span class="hljs-attribute">chroot_list_enable</span>=<span class="hljs-literal">NO</span>，<br><span class="hljs-attribute">chroot_local_user</span>=<span class="hljs-literal">YES</span>时，所有的用户均不能切换到其他目录。<br>④当<span class="hljs-attribute">chroot_list_enable</span>=<span class="hljs-literal">NO</span>，<br><span class="hljs-attribute">chroot_local_user</span>=<span class="hljs-literal">NO</span>时，所有的用户均可以切换到其他目录。<br><br><span class="hljs-attribute">chroot_local_user</span>=<span class="hljs-literal">YES</span><br><span class="hljs-attribute">chroot_list_enable</span>=<span class="hljs-literal">YES</span><br><span class="hljs-attribute">chroot_list_file</span>=/etc/vsftpd/chroot_list<br><br><span class="hljs-comment">#这个是pam模块的名称，我们放置在/etc/pam.d/vsftpd</span><br><span class="hljs-attribute">pam_service_name</span>=vsftpd<br><br><span class="hljs-comment">#当然我们都习惯支持TCP Wrappers的啦！</span><br><span class="hljs-attribute">tcp_wrappers</span>=<span class="hljs-literal">YES</span><br><br><span class="hljs-comment">#不添加下面这个会报错：500 OOPS: vsftpd: refusing to run with writable root inside chroot()</span><br><span class="hljs-attribute">allow_writeable_chroot</span>=<span class="hljs-literal">YES</span><br><br><span class="hljs-comment">#ftp的端口号</span><br><span class="hljs-attribute">listen_port</span>=60021<br><span class="hljs-comment">#启动被动式联机(passivemode)</span><br><span class="hljs-attribute">pasv_enable</span>=<span class="hljs-literal">YES</span><br><span class="hljs-comment">#上面两个是与passive mode 使用的 port number 有关，如果您想要使用65400 到65410 这 11 个 port 来进行被动式资料的连接，可以这样设定</span><br><span class="hljs-attribute">pasv_min_port</span>=65400<br><span class="hljs-attribute">pasv_max_port</span>=65410<br><br><span class="hljs-comment">#FTP访问目录</span><br><span class="hljs-attribute">local_root</span>=/data/ftp/<br></code></pre></td></tr></table></figure>

<ul>
<li>启动暂停查看服务状态命令 </li>
<li><code>启动systemctl start vsftpd.service</code>  </li>
<li><code>暂停 systemctl status vsftpd.service</code></li>
<li>创建FTP用户<br> 添加FTP用户命令：useradd XXX<br>  设置FTP用户密码：passwd XXX</li>
</ul>
<h6 id="完结-呼"><a href="#完结-呼" class="headerlink" title="完结 呼~~~"></a>完结 呼~~~</h6><hr>

              
            </div>
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" class="category-chain-item">学习笔记</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/Linux/">#Linux</a>
      
        <a href="/tags/Centos7/">#Centos7</a>
      
        <a href="/tags/VMware/">#VMware</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>VMware安装Centos7,Centos7下配置DNS服务器,配置WEB服务器,配置FTP服务器</div>
      <div>https://zjy365.github.io/2021/06/23/VMware/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>zjy</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2021年6月23日</div>
        </div>
      
      
      <div class="license-meta-item">
        <div>许可协议</div>
        <div>
          
            
            
              <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
              <span class="hint--top hint--rounded" aria-label="BY - 署名">
                <i class="iconfont icon-by"></i>
              </span>
              </a>
            
          
        </div>
      </div>
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2021/06/28/npm%E5%8F%91%E5%8C%85%E9%97%AE%E9%A2%98/" title="发npm包，遇到问题">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">发npm包，遇到问题</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2021/06/19/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F/" title="正则表达式的学习">
                        <span class="hidden-mobile">正则表达式的学习</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  






    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
  
    <!-- 备案信息 ICP for China -->
    <div class="beian">
  <span>
    <a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
      豫ICP备2021008845号-1
    </a>
  </span>
  
</div>

  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>






  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      headingSelector : CONFIG.toc.headingSelector || 'h1,h2,h3,h4,h5,h6',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      collapseDepth   : CONFIG.toc.collapseDepth || 0,
      scrollSmooth    : true,
      headingsOffset  : -boardTop
    });
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }
  });
</script>


  <script>
  (function() {
    var enableLang = CONFIG.code_language.enable && CONFIG.code_language.default;
    var enableCopy = CONFIG.copy_btn;
    if (!enableLang && !enableCopy) {
      return;
    }

    function getBgClass(ele) {
      return Fluid.utils.getBackgroundLightness(ele) >= 0 ? 'code-widget-light' : 'code-widget-dark';
    }

    var copyTmpl = '';
    copyTmpl += '<div class="code-widget">';
    copyTmpl += 'LANG';
    copyTmpl += '</div>';
    jQuery('.markdown-body pre').each(function() {
      var $pre = jQuery(this);
      if ($pre.find('code.mermaid').length > 0) {
        return;
      }
      if ($pre.find('span.line').length > 0) {
        return;
      }

      var lang = '';

      if (enableLang) {
        lang = CONFIG.code_language.default;
        if ($pre[0].children.length > 0 && $pre[0].children[0].classList.length >= 2 && $pre.children().hasClass('hljs')) {
          lang = $pre[0].children[0].classList[1];
        } else if ($pre[0].getAttribute('data-language')) {
          lang = $pre[0].getAttribute('data-language');
        } else if ($pre.parent().hasClass('sourceCode') && $pre[0].children.length > 0 && $pre[0].children[0].classList.length >= 2) {
          lang = $pre[0].children[0].classList[1];
          $pre.parent().addClass('code-wrapper');
        } else if ($pre.parent().hasClass('markdown-body') && $pre[0].classList.length === 0) {
          $pre.wrap('<div class="code-wrapper"></div>');
        }
        lang = lang.toUpperCase().replace('NONE', CONFIG.code_language.default);
      }
      $pre.append(copyTmpl.replace('LANG', lang).replace('code-widget">',
        getBgClass($pre[0]) + (enableCopy ? ' code-widget copy-btn" data-clipboard-snippet><i class="iconfont icon-copy"></i>' : ' code-widget">')));

      if (enableCopy) {
        Fluid.utils.createScript('https://lib.baomitu.com/clipboard.js/2.0.10/clipboard.min.js', function() {
          var clipboard = new window.ClipboardJS('.copy-btn', {
            target: function(trigger) {
              var nodes = trigger.parentNode.childNodes;
              for (var i = 0; i < nodes.length; i++) {
                if (nodes[i].tagName === 'CODE') {
                  return nodes[i];
                }
              }
            }
          });
          clipboard.on('success', function(e) {
            e.clearSelection();
            e.trigger.innerHTML = e.trigger.innerHTML.replace('icon-copy', 'icon-success');
            setTimeout(function() {
              e.trigger.innerHTML = e.trigger.innerHTML.replace('icon-success', 'icon-copy');
            }, 2000);
          });
        });
      }
    });
  })();
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
